﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Himp.Platform.Migrations
{
    /// <inheritdoc />
    public partial class add_column_dept_ConfirmedFlag : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MainOrganInfo");

            migrationBuilder.AddColumn<bool>(
                name: "ConfirmedFlag",
                table: "MainDept",
                type: "boolean",
                nullable: false,
                defaultValue: false);

            migrationBuilder.CreateTable(
                name: "MainOrgan",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    OrganCodg = table.Column<string>(type: "text", nullable: false),
                    OrganName = table.Column<string>(type: "text", nullable: false),
                    Subtitle = table.Column<string>(type: "text", nullable: false),
                    Website = table.Column<string>(type: "text", nullable: false),
                    Itro = table.Column<string>(type: "text", nullable: true),
                    Addr = table.Column<string>(type: "text", nullable: true),
                    Longitude = table.Column<double>(type: "double precision", nullable: true),
                    Latitude = table.Column<double>(type: "double precision", nullable: true),
                    Cover = table.Column<string>(type: "text", nullable: true),
                    Begntime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    Endtime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    AdminName = table.Column<string>(type: "text", nullable: false),
                    AdminTel = table.Column<string>(type: "text", nullable: false),
                    AdminEmail = table.Column<string>(type: "text", nullable: false),
                    AdminPwd = table.Column<string>(type: "text", nullable: false),
                    OrganStatus = table.Column<int>(type: "integer", nullable: false),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MainOrgan", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "MainOrgan");

            migrationBuilder.DropColumn(
                name: "ConfirmedFlag",
                table: "MainDept");

            migrationBuilder.CreateTable(
                name: "MainOrganInfo",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uuid", nullable: false),
                    ADDR = table.Column<string>(type: "text", nullable: true),
                    ADMIN_EMAIL = table.Column<string>(type: "text", nullable: false),
                    ADMIN_NAME = table.Column<string>(type: "text", nullable: false),
                    ADMIN_PWD = table.Column<string>(type: "text", nullable: false),
                    ADMIN_TEL = table.Column<string>(type: "text", nullable: false),
                    BEGNTIME = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: false),
                    COVER = table.Column<string>(type: "text", nullable: true),
                    CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
                    CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
                    ENDTIME = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    ExtraProperties = table.Column<string>(type: "text", nullable: false),
                    ITRO = table.Column<string>(type: "text", nullable: true),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
                    LastModifierId = table.Column<Guid>(type: "uuid", nullable: true),
                    LATITUDE = table.Column<double>(type: "double precision", nullable: true),
                    LONGITUDE = table.Column<double>(type: "double precision", nullable: true),
                    ORGAN_CODG = table.Column<string>(type: "text", nullable: false),
                    ORGAN_NAME = table.Column<string>(type: "text", nullable: false),
                    ORGAN_STATUS = table.Column<int>(type: "integer", nullable: false),
                    SUBTITLE = table.Column<string>(type: "text", nullable: true),
                    TenantId = table.Column<Guid>(type: "uuid", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_MainOrganInfo", x => x.Id);
                });
        }
    }
}
